//comparing strings using arrays
#include<iostream>
#include<cstring>       //prototype for strcmp()
int main()
{
    using namespace std;
    char word[5] = "?ate";
    for(char ch = 'a';strcmp(word,"mate");ch++)//这里使用了strcmp()函数来对比两个字符串,每回合对比失败后将依次枚举,知道成功对比
    {
        cout<<word<<endl;
        word[0] = ch;
    }
    cout <<"After loop ends,word is " << word <<endl;
    return 0;
}
